package com.baimawangzi.recovery.servlet.activity;

import com.baimawangzi.recovery.bean.Activity;
import com.baimawangzi.recovery.service.impl.ActivityServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/activityfindbyid.do")
public class ActivityFindById extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        ActivityServiceImpl activityService = new ActivityServiceImpl();
        //解析url参数
        int id = Integer.parseInt(req.getParameter("id"));
        Activity activity = activityService.findById(id);
        System.out.println(activity+"111111111111111111");
        req.setAttribute("activity",activity);
        req.getRequestDispatcher("activity_update.jsp").forward(req,resp);
    }
}
